package com.snow.common.base;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel
public class BaseEntity implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.INPUT)
    private Long id;
    /**
     * 创建用户
     */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(readOnly = true, value = "创建人id")
    private Long createUserId;

    /**
     * 创建时间
     */
    @ApiModelProperty(readOnly = true, value = "创建时间")
    @TableField(insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    /**
     * 更新用户
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(readOnly = true, value = "更新时间")
    private Long updateUserId;

    /**
     * 更新时间
     */
    @TableField(insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    @ApiModelProperty(readOnly = true, value = "创建人id")
    private Date updateTime;

    @TableField(exist = false)
    @ApiModelProperty(readOnly = true, value = "启用,停用 状态")
    private Integer commonStatus;

    /**
     * 删除标识
     */
    @TableLogic
    @ApiModelProperty(readOnly = true, value = "逻辑删除")
    @JsonIgnore
    private Integer isDel;
}
